
# class Animal:
#     name='animal'
#     def  shout(self ):
#         print('animal shout')
# animal=Animal()
# print(animal.name)
# animal.shout()
class Dog:
    name='dog'

    def __init__(self):
        self.age = 19

    def  eat(self ):
        print('dog eat')
dog1=Dog()
print(dog1.name)
print(Dog.name)
print(dog1.age)

dog1.name="zhuhaotian"
print(dog1.name)
print(Dog.name)

Dog.name="Zhu"
print(dog1.name)
print(Dog.name)
print('--------------')

dog2=Dog()
print(dog2.name)               #类属性只能通过类来更改，对象属性可以通过类或者对象来改
